package zh.keep.all.work

import android.content.Context
import android.util.Log
import androidx.work.Worker
import androidx.work.WorkerParameters
import zh.keep.all.Utils
import java.text.SimpleDateFormat
import java.util.*

/**
 * WorkerManager定时任务
 */
class TimingWorker(
    context: Context,
    params: WorkerParameters
) : Worker(context, params) {

    override fun doWork(): Result {
        // 定时任务
        Utils.startService()
        Log.i("Worker", "拉起服务"+ SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date(System.currentTimeMillis())))
        return Result.success()
    }

}
